package school.person;

import school.course.Course;

public class Teacher extends Person {
    private String courseId;  // 所授课程编号

    // 子类构造方法
    public Teacher(String teacherId, String teacherName, String gender, String courseId) {
        super(teacherId, teacherName, gender);
        this.courseId = courseId;
    }

    // 实现父类抽象方法：打印教师授课信息
    @Override
    public void printWorksheet() {
        System.out.println("教师 " + getName() + " 的授课信息:");
    }

    // Getter和Setter
    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    @Override
    public String toString() {
        return "教师编号: " + id + ", 教师姓名: " + getName() + ", 性别: " + gender + ", 所授课程编号: " + courseId;
    }
}